<script>
        
// 动物类    属性：长相look   方法：进食eat:fn 

//两栖类    属性：肤色color    方法：入水waterInto  上岸waterOut
     
//哺乳类    属性:肤色color  几只腿 leg     方法: 爬creep:fn

//鸟类      属性:羽毛颜色color  翅展wingspan   方法:飞fly:fn

//虎类    属性：品种type  速度speed  方法:捕猎 hunt:fn

//鹰类   属性:品种 type   飞行速度speed   视力vision  方法:捕猎 hunt:fn

// 继承关系：
//  两栖类---动物类--Object-null
//  虎类---哺乳类---动物类--Object-null
//  鹰类-鸟类---动物类--Object-null

function Animal(look){
    this.look = look
}
Animal.prototype.eat = function(){
    return "我正在进食";
}

// 两栖类
function Amphibious(color,look){
    this.color = color
    Animal.call(this,look)
    
}
Amphibious.prototype.waterInto = function(){
    return "我正入水"
}
Amphibious.prototype.waterOut = function(){
    return "我正上岸"
}
Amphibious.prototype.__proto__ = Animal.prototype
// 哺乳类

class Lactation extends Animal{
    constructor(color,leg,look){
        super(look)
        this.color = color
        this.leg = leg
    }
    creep(){
        return "我正在爬行"
    }
}

// 虎
class Tiger extends Lactation{
    constructor(type,speed,color,leg,look){
        super(color,leg,look)
        this.type=type
        this.speed=speed
    }
    hunt(){
        return "我正在捕猎"
    }
}
// 鸟
function Bird(color,wingspan,look){
    this.color = color
    this.wingspan = wingspan
    Animal.apply(this,[look])
}
Bird.prototype = Object.create(Animal.prototype)
Bird.prototype.constructor = Bird
 Bird.prototype.fly = function(){
    return "我在飞"
}

function Eagle(type,speed,vision,[color,wingspan,look]){
    this.type=type
    this.speed=speed
    this.vision=vision
    Bird.apply(this,[color,wingspan,look])
}
Eagle.prototype.hunt=function(){
    return "我在天空猎食"
}
Object.assign(Eagle.prototype,Bird.prototype)
Eagle.prototype.constructor = Eagle

let d = new Animal("好看")
let d1 = new Amphibious("红","还行")
// 哺乳
let d2 =new Lactation("橙","四只腿","帅")
let d3 =new Tiger("东北虎","10000","黄","四支腿","完美")
// 鸟
let d4 =new Bird("绿","未展翅","一班班")
let d5 =new Eagle("猫头鹰","3000","良好",["青","展翅翱翔","美"])
console.log(d);
console.log(d1);
console.log(d2);
console.log(d3);
console.log(d4);
console.log(d5);




</script>